function [status] = GRASP_CheckSolution(scheduledTargets, olTargets, olBins)
%GRASP_CheckSolution Summary of this function goes here
%   Detailed explanation goes here

% Check for temporal constraint violations
bins(1:length(scheduledTargets)) = 0;
for n = 1:length(scheduledTargets)
%   for k = 1:length(olTargets)
%     if scheduledTargets(n) == olTargets(k)
%       bins(n) = olBins(k);
%       break;
%     end
%   end
  bins(n) = olBins(olTargets == scheduledTargets(n));
end

status = 1;
for k = 2:length(bins)
  if bins(k) < bins(k-1)
    status = 0;
    break;
  end
end

% Check for duplicates
for n = 1:length(scheduledTargets)
  for k = 1:length(scheduledTargets)
    if (n ~= k) && (scheduledTargets(n) == scheduledTargets(k))
      status = 0;
    end
  end
end
end